home *** CD-ROM | disk | FTP | other *** search
- \
- \ DEFER.ATL
- \
- \ Copyright (C) 1993 by Derrick Oswald
- \
- \ Derrick Oswald
- \ Nexsys Consulting Inc.
- \ 44 Douglas Drive
- \ Ayr, Ontario
- \ N0B 1E0
- \ (519) 632-8243
- \ (519) 632-8244 FAX
- \
- \ Description:
- \ defered words definitions
- \
- \ useage:
- \ defer myvariable
- \ ...
- \ : definition ... ;
- \ ...
- \ ptr definition is myvariable
- \ ...
- \ myvariable
-
- .( "\nLoading defered definitions..."
-
- \ warning - default behavior of deferred words
- : warning ( -> )
- ." "\nUninitialised deferred word"
- ;
-
- \ defer - deferred execution defining word
- : defer ( -> )
- create
- ['] warning ,
- does>
- @ execute
- ;
-
- \ pointer - definition address fetcher
- : pointer ( -> cfa )
- ' \ get the next word in the compilation stream
- \ this should be
- \ [compile] literal
- \ but atlas complains if compiler words are used outside a : definition
- state @ if
- compile (lit) ,
- then
- ; immediate
-
- \ is - deferred word redefiner
- : is ( cfa -> )
- ' \ get the next word in the compilation stream
- >body
- state @ if
- compile (lit) ,
- compile !
- else
- !
- then
- ; immediate
-
- .( "\nLoaded.\n"
-